<script setup>
import {ElMessage, ElNotification} from 'element-plus'

const open = () => {
  ElNotification({
    title: '提示',
    message: '这是一个通知！',
  })
}

const say = () => {
  ElMessage({
    type: 'success',
    message: '这是一个弹框！',
    showClose: true,
  })
}

defineExpose({open, say})
</script>

<template>
  <el-container>
    <el-main>
      <el-card style="width: 100%;height: 450px">
        <h1>我是子组件</h1>
        <el-button plain @click="say">提示框</el-button>
        <el-button plain @click="open">通知框</el-button>
      </el-card>
    </el-main>
  </el-container>
</template>

<style scoped>

</style>